@import '../../variables';

.mastodon-preview__card {
	display: flex;

	margin-top: 1rem;
	margin-bottom: 1rem;

	border: solid 1px #d9e1e8;
	border-radius: 8px;
	overflow: hidden;
	color: $mastodon-body-text-color;

	&.has-image {
		flex-direction: column;
	}

	&.has-image &-img {
		width: 100%;
	}
}

.mastodon-preview__card-img {
	min-height: 60px;

	img {
		display: block;

		width: 100%;
		min-height: 100%;
		object-fit: cover;

		border-start-start-radius: inherit;
		border-end-start-radius: inherit;
	}

	&--fallback {
		aspect-ratio: 1;
		background: #c0cdd9;
		position: relative;
		width: 120px;
		display: flex;
		align-items: center;
		justify-content: center;
	}
}

.mastodon-preview__card-text {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem;
	overflow: hidden;
}

.mastodon-preview__card-title {
	color: #282c37;

	/* stylelint-disable-next-line scales/font-sizes */
	font-size: 1.187rem;
	font-weight: 700;
	line-height: 1.4;
}

.mastodon-preview__card-site {
	font-size: 0.875rem;
	display: block;
}

.mastodon-preview__card-description {
	font-size: 0.875rem;
	overflow: hidden;
	text-overflow: ellipsis;

	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	display: -webkit-box;
}
